<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 商城管理 <span class="c-gray en">&gt;</span> 商品分类管理<span class="c-gray en">&gt;</span> 商品分类修改</nav>
		<div id="sectionContent" class="Hui-article">
		<article class="page-container">
			<input type="hidden" id="classificationId" v-model="content.id"/>
			<div class="form form-horizontal" id="form-admin-add">
        <div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>分类名称：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" id="classificationName" v-model="content.classificationName">
					</div>
				</div>
        <div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>ICON：</label>
					<div class="formControls col-xs-8 col-sm-9">
            <div><img src="{{content.classificationIcon}}" onerror="this.src='http://p3cxjq83j.bkt.clouddn.com/pic_not_found.png'" width="80" height="80" id="classificationIconShow" style="border:1px solid #ccc;margin:10px;" accept="image/*"/></div>
						<input type="file" class="input-text" onchange="checkField($('#classificationIconShow'),$('#classificationIcon'),this.files[0])">
            <input type="hidden" id="classificationIcon"  v-model="content.classificationIcon"/>
					</div>
				</div>
        <div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>排列顺序：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" id="classificationOrder" v-model="content.classificationOrder">
					</div>
				</div>
				<div class="row cl">
					<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
						<input class="btn btn-primary" type="button" v-on:click="saveData()" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" style="margin-right:30px;">
						<input class="btn" type="button" onclick="javascript:history.go(-1)" value="&nbsp;&nbsp;取消&nbsp;&nbsp;">
					</div>
				</div>
			</div>
		</article>
	</div>
<script>
      new Vue({
          el:'#sectionContent',
          http: authorization(),
          data:{
              content:{}
          },
          created:function(){
              this.$http.get('/restful/shopping/v1.0/classification/'+getQueryString('id')).then((response) => {
                  this.content = responseObj(response).data;
              }).catch(function(response) {
                  alert(errorMsg(response));
              });
          },
          methods:{
              backToList:function(){
                  window.parent.location.href="#!view/shopping/classification/classification-list.html?"+Math.random();
              },
              saveData:function(){
                  var formData = {
                    classificationName:$('#classificationName').val(),
                    classificationIcon:$('#classificationIcon').val(),
                    classificationOrder:$('#classificationOrder').val()
                  };
                  this.$http.put('/restful/shopping/v1.0/classification/'+$('#classificationId').val(),formData).then((response) => {
                      this.backToList();
                  }).catch(function(response) {
                      alert(errorMsg(response));
                  });
              }
          }
      });
  </script>
